package com.example.file_explorer.entity;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Set;

@Data
@AllArgsConstructor
public class FileNode {
    private String fileName;
    private Long size; //文件大小
    private Long creationTime; //创建时间
    private Long lastAccessTime; //最后访问时间
    private Long lastModifiedTime; //最后修改时间
    private Set<FileNode> children; //子节点
    private Boolean isDirectory; //是否为文件夹

    public FileNode(FileNode other) {
        this.fileName = other.getFileName();
        this.size = other.getSize();
        this.creationTime = other.getCreationTime();
        this.lastAccessTime = other.getLastAccessTime();
        this.lastModifiedTime = other.getLastModifiedTime();
        this.isDirectory = other.getIsDirectory();
        children = null;
    }
}
